/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package rsteste;

import commonSources.Cartao;
import commonSources.Cliente;
import commonSources.Funcionario;
import commonSources.Painel;
import java.io.IOException;
import java.rmi.RemoteException;
import cbaServer.FileHandler;
import java.util.Hashtable;

/**
 *
 * @author Rente
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws RemoteException, IOException {
        // TODO code application logic here

        FileHandler fh = FileHandler.getInstance();
        Hashtable<String, Painel> listaPaneis = new Hashtable<String, Painel>();
        Hashtable<String, Funcionario> listaFuncionarios = new Hashtable<String, Funcionario>();
        Hashtable<String, Cliente> listaClientes = new Hashtable<String, Cliente>();


        Cliente clientX = new Cliente("Filipe Lourenço", "001");

        Painel painel = new Painel("P01", "FORD MAKES YOU WANT TO FLY!", "ford.jpg");
        listaPaneis.put(painel.getId(), painel);
        clientX.setPainel(painel);
        listaClientes.put(clientX.getId(), clientX);




        clientX = new Cliente("Luis Rente", "002");
        
        painel = new Painel("P02", "Há muitos anos a alumiare a sua vida", "edp.jpg");
        listaPaneis.put(painel.getId(), painel);
        clientX.setPainel(painel);
        listaClientes.put(clientX.getId(),clientX);


        Funcionario f1 = new Funcionario("001", "Nelso");
        Cartao cartaoX = new Cartao("9001", "1", "");
        f1.setCartao(cartaoX);
        listaFuncionarios.put(f1.getIdFuncionario(), f1);

        f1 = new Funcionario("002", "Vitor");
        cartaoX = new Cartao("9002", "1", "");
        f1.setCartao(cartaoX);
        listaFuncionarios.put(f1.getIdFuncionario(), f1);


        fh.savePanels(listaPaneis);
        fh.saveClientes(listaClientes);
        fh.saveFuncionarios(listaFuncionarios);

    }
}
